﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using App1AppHandler;

namespace Reborn_Server.App1AppHandler
{
    public class Spell_LethargyBuff : Buff
    {
        private int AtkSpeedPercentAdded = 10;
        private int MovementSpeedPercentAdded = 10;

        public Spell_LethargyBuff() 
        {
            minutesLeft = 3;
        }

        override public void Resume(CreatureBase targetCreatureBase, SpellIcon _spellIcon, int timeRemaining, int castLevel, int castCharacterID, int castInt, int castWis, int optionalValue, string xmlData)
        {
            minutesLeft = timeRemaining;

            base.Resume(targetCreatureBase, _spellIcon, timeRemaining, castLevel, castCharacterID, castInt, castWis, optionalValue, xmlData);
            
            TargetCreatureBase.MeleeSpeedPercentModifier = TargetCreatureBase.MeleeSpeedPercentModifier + AtkSpeedPercentAdded;
            TargetCreatureBase.MeleeSpeedPercentModifier = TargetCreatureBase.MovementSpeedPercentModifier + MovementSpeedPercentAdded;

            
            spellTimer.Start();
        }

        public override void RemoveSpell(bool updateBuffs, bool sendMessage)
        {
            base.RemoveSpell(updateBuffs, sendMessage);

            TargetCreatureBase.MeleeSpeedPercentModifier = TargetCreatureBase.MeleeSpeedPercentModifier - AtkSpeedPercentAdded;
            TargetCreatureBase.MeleeSpeedPercentModifier = TargetCreatureBase.MovementSpeedPercentModifier - MovementSpeedPercentAdded;
        }
    }
}
